<?php include('config.php');/*引入变量文件*/?>
<style>
<?php include('css/index.css');/*引入css文件*/?>
</style>
<div class='container'>
<center>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' /><?php
$wz = $_POST['wz'];//获取源网址
$hz = $_POST['hz'];//获取后缀
$bz = $_POST['bz'];//获取备注
/*温馨提示*/
if ($wz == null) {
    die('请输入即将缩短的网址！');
}
if ($hz == null) {
    die('请输入自定义后缀！');
}
if ($bz == null) {
    $bz = "无" ;
}
$time = date("Y-m-d H:i:s");//获取时间
$content = '【' . $wz . '】〖' . $hz . '〗〈' . $bz . '〉〔1〕';//组合方式
/*判断是否重复内容*/
if (substr_count(file_get_contents($file), $content) > 0) {
    die("<title>不要重复提交哦</title><h1>请勿重复提交！</h1>");
}
if (substr_count(file_get_contents($file), $hz) > 0) {
    die("<title>后缀被抢占了QAQ</title><h1>后缀重复了～</h1>");
}
/*追加写入内容*/
file_put_contents($file, $content . '［' . $time . '］', FILE_APPEND);
if($ewm = null){
die("<title>缩短成功</title><h1>缩短成功！</h1><br>缩短的网址为:<br>" . $ym . "/" . $hz );
}else{
die("<title>缩短成功</title><h1>缩短成功！</h1><br>缩短的网址为:<br>" . $ym . "/" . $hz . "<br><br><br><img src=' " . $ewm .  $ym . "/" . $hz . " alt='二维码' />");
}
?></center></div>
